/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.cip.esymons.colegiatura.bc;

import java.util.List;
import javax.ejb.Stateless;
import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;
import org.cip.esymons.colegiatura.be.Deporte;

/**
 *
 * @author ADMINISTRADOR
 */
@Stateless
public class DeporteFacade implements DeporteFacadeLocal {
    @PersistenceContext
    private EntityManager em;

    public void create(Deporte deporte) {
        em.persist(deporte);
    }

    public void edit(Deporte deporte) {
        em.merge(deporte);
    }

    public void remove(Deporte deporte) {
        Deporte aux = em.merge(deporte);
        em.remove(aux);
    }

    public Deporte find(Object id) {
        return em.find(Deporte.class, id);
    }

    public List<Deporte> findAll() {
        return em.createQuery("select object(o) from Deporte as o order by o.depDescripcion").getResultList();
    }

    
}
